#include "Sphere.h"

using namespace RayTracer;

CSphere::CSphere(const CVector3& center, const float& radius)
{
	m_Center = center;
	m_Radius = radius;
	m_SquareRadius = radius * radius;
	m_InvRadius = 1.f / radius;
}

CSphere::~CSphere(void)
{
}

CSphere::IntersectionStatus CSphere::IntersectRay(RayTracer::CRay &ray, float &dist)
{
	// TODO

}

CVector3 CSphere::getNormal(const RayTracer::CVector3 &pos)
{
	CVector3 res = (pos - m_Center) * m_InvRadius;
	return res;
}